//
//  UIViewController+ViewController_return.m
//  购房通
//
//  Created by URANUS on 15/9/4.
//  Copyright (c) 2015年 URANUS. All rights reserved.
//

#import "UIViewController+ViewController_return.h"

@implementation UIViewController (ViewController_return)

-(void)TurnBack{
    UIButton *button=[UIButton buttonWithType:UIButtonTypeCustom];
    [button setImage:[UIImage imageNamed:@"turnBackButton.png"] forState:UIControlStateNormal];
    [button setFrame: CGRectMake(0, 0, 20, 20)];
    [button addTarget:self action:@selector(back2) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:button];
    self.navigationController.interactivePopGestureRecognizer.delegate=(id)self;
    self.view.backgroundColor=[UIColor whiteColor];
}

-(void)back2{
    [self.navigationController popViewControllerAnimated:YES];
    [self.navigationController dismissViewControllerAnimated:YES completion:nil];
}

@end
